class ANode{
	public BNode bnode;
	public int value;
}

class BNode{
	public CNode cnode;
	public int value;
}

class CNode{
	public DNode dnode;
	public int value;
}

class DNode{
	public BNode bnode;
	public int value;
}

public class SyntaxTest5 {
	public static void main(String[] str) {
		ANode A1;
		BNode B1;
		CNode C1;
		DNode D1;
		
		A1 = new ANode();
		A1.value=1;
		A1.bnode = new BNode();
		A1.bnode.cnode = new CNode();
		A1.bnode.value = 2;
		A1.bnode.cnode.dnode = new DNode();
		A1.bnode.cnode.value = 3;
		A1.bnode.cnode.dnode.bnode = A1.bnode;
		A1.bnode.cnode.dnode.value = 4;
		
		A1 = new ANode();
		A1.value=5;
        B1 = new BNode();
        B1.value = 6;
        C1 = new CNode();
        C1.value = 7;
        D1 = new DNode();
        D1.value = 8;
        A1.bnode = B1;
        B1.cnode = C1;
        C1.dnode = D1;
        D1.bnode = B1;
        
        B1 = new BNode();
        B1.value = 9;
        C1 = new CNode();
        C1.value = 10;
        D1 = new DNode();
        D1.value = 11;
        
        StaticJavaLib.println(A1.value);
        StaticJavaLib.println(B1.value);
        StaticJavaLib.println(C1.value);
        StaticJavaLib.println(D1.value);
	}
}
